#include <iostream>
#include <string>
#include <fstream>
using std::cout;
using std::endl;
using std::cerr;
using std::ifstream;
using std::string;

void test(){
    ifstream ifs("test2.txt");
    if(!ifs.good()){
        cerr << "ifstream is not good" << endl;
        return;
    }

    string word;
    while(getline(ifs, word)){
        cout << word << endl;
    }
    cout << endl;
    ifs.close();
}

int main()
{
    test();
    return 0;
}
